home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vegask1a / printfor.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-02-21  |  3.4 KB  |  118 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form print2form 
  4.    Caption         =   "Bragging Board"
  5.    ClientHeight    =   1665
  6.    ClientLeft      =   6510
  7.    ClientTop       =   4695
  8.    ClientWidth     =   2535
  9.    Icon            =   "printform.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1665
  12.    ScaleWidth      =   2535
  13.    ShowInTaskbar   =   0   'False
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin MSComDlg.CommonDialog CommonDialog1 
  16.       Left            =   0
  17.       Top             =   1200
  18.       _ExtentX        =   847
  19.       _ExtentY        =   847
  20.       _Version        =   393216
  21.    End
  22.    Begin VB.CommandButton cancel 
  23.       Cancel          =   -1  'True
  24.       Caption         =   "&CANCEL"
  25.       Height          =   375
  26.       Left            =   600
  27.       TabIndex        =   2
  28.       Top             =   1200
  29.       Width           =   1335
  30.    End
  31.    Begin VB.CommandButton printoptions 
  32.       Caption         =   "Print Keno Stats"
  33.       Height          =   375
  34.       Left            =   120
  35.       TabIndex        =   1
  36.       Top             =   600
  37.       Width           =   2295
  38.    End
  39.    Begin VB.CommandButton printboard 
  40.       Caption         =   "Command1"
  41.       Height          =   375
  42.       Left            =   120
  43.       TabIndex        =   0
  44.       Top             =   120
  45.       Width           =   2295
  46.    End
  47. Attribute VB_Name = "print2form"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = False
  50. Attribute VB_PredeclaredId = True
  51. Attribute VB_Exposed = False
  52. Private Sub cancel_Click()
  53. Unload Me
  54. End Sub
  55. Private Sub Form_Activate()
  56. If board.Visible = False Then
  57. printboard.Enabled = False
  58. printboard.Caption = "Display Keno Board To Print"
  59. printboard.Enabled = True
  60. printboard.Caption = "Print Keno Board"
  61. End If
  62. End Sub
  63. Private Function printboardsub()
  64. If board.Visible = True Then
  65.     Dim BeginPage, EndPage, NumCopies, i
  66.     ' Set Cancel to True
  67.   CommonDialog1.CancelError = True
  68.     On Error GoTo ErrHandler
  69.     ' Display the Print dialog box
  70.    CommonDialog1.ShowPrinter
  71.     ' Get user-selected values from the dialog box
  72.     BeginPage = CommonDialog1.FromPage
  73.     EndPage = CommonDialog1.ToPage
  74.     NumCopies = CommonDialog1.Copies
  75.     For i = 1 To NumCopies
  76.     board.PrintForm
  77.     Next i
  78.     Exit Function
  79. ErrHandler:
  80.     ' User pressed the Cancel button
  81.     Exit Function
  82.     Else
  83.         MsgBox " display keno board to print", vbOKOnly
  84.         End If
  85. End Function
  86. Private Sub form_load()
  87. Call ShadeForm(Me)
  88. If board.Visible = False Then
  89. printboard.Enabled = False
  90. printboard.Caption = "Display Keno Board To Print"
  91. End If
  92. End Sub
  93. Private Sub printboard_Click()
  94. Call printboardsub
  95. End Sub
  96. Private Sub printoptions_Click()
  97. statsform.Show
  98. End Sub
  99. Sub ShadeForm(Frm As Form)
  100.     Dim iLoop As Integer
  101.     Dim NumberOfRects As Integer
  102.     Dim GradColor As Long
  103.     Dim GradValue As Integer
  104.     Frm.ScaleMode = 3
  105.     Frm.DrawStyle = 6
  106.     Frm.DrawWidth = 2
  107.     Frm.AutoRedraw = True
  108.     NumberOfRects = 64
  109.     For iLoop = 1 To 64
  110.         GradValue = 255 - (iLoop * 4 - 1)
  111.         
  112.         GradColor = RGB(GradValue, GradValue, GradValue)
  113.         Frm.Line (0, Frm.ScaleHeight * (iLoop - 1) / 64)-(Frm.ScaleWidth, Frm.ScaleHeight * iLoop / 64), GradColor, BF
  114.         
  115.     Next iLoop
  116.     Frm.Refresh
  117. End Sub
  118.